<template>
  <div class="work-record-header">
    <el-row>
      <el-col :span="24">
        <!-- 搜索部分 -->
        <el-form :inline="true" :model="formInline" label-width="130px">
          <el-form-item label="批号">
            <el-input v-model="formInline.lotId" placeholder="请输入内容" clearable />
          </el-form-item>
          <el-form-item label="mes hold 代码">
            <el-input v-model="formInline.holdCode" placeholder="请输入内容" clearable />
          </el-form-item>
          <el-form-item label="是否call mes hold">
            <el-select v-model="formInline.callMESHold" clearable>
              <el-option label="not call mes hold" value="0"/>
              <el-option label="call mes hold" value="1"/>
            </el-select>
          </el-form-item>
          <el-form-item label="trackIn 时间">
            <el-date-picker
              v-model="trackinStamp"
              type="daterange"
              range-separator="至"
              start-placeholder="trackIn时间"
              end-placeholder="trackIn时间"
              format="yyyy-MM-dd HH:mm:ss"
              value-format="yyyy-MM-dd HH:mm:ss"

            />
          </el-form-item>
          <el-form-item>
            <el-button type="primary" icon="el-icon-search" @click="doSearch">{{ $t('search') }}</el-button>
          </el-form-item>
        </el-form>
      </el-col>
    </el-row>
  </div>
</template>
<script>
export default {
  name: 'WorkRecordHeader',
  data() {
    return {
      formInline: {},
      trackinStamp: null // 日期选择
    }
  },
  methods: {
    doSearch() {
      if (this.trackinStamp !== null && this.trackinStamp.length > 0) {
        this.formInline.StartTrackinStamp = this.trackinStamp[0]
        this.formInline.EndTrackinStamp = this.trackinStamp[1]
      } else {
        this.formInline.StartTrackinStamp = null
        this.formInline.EndTrackinStamp = null
      }
      this.$emit('doSearch', this.formInline)
    }
  }
}
</script>
<style lang="scss" scoped>
@import "~@/assets/styles/defaultStyle.scss";
.el-dropdown-link {
  cursor: pointer;
  color: #409eff;
}
.el-icon-arrow-down {
  font-size: 12px;
}
</style>
